package com.tiancheng.trade.settlement.bo;

import com.tiancheng.trade.settlement.util.AmountUtil;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 收入汇总统计实体
 * @author likailun
 */
@Data
public class SRevenueSummaryExportBO {

    /**
     * 收入确认类型-名称
     */
    private String revenueTypeName;

    /**
     * 收入确认-销售金额
     */
    private BigDecimal subOrderAmountTotalBD;

    /**
     * 收入确认-优惠金额
     */
    private BigDecimal discountTotalBD;

    /**
     * 收入确认-结算金额
     */
    private BigDecimal revenueAmountTotalBD;

    /**
     * 收入确认-收入金额
     */
    private BigDecimal productCostTotalBD;

    /**
     * 收入确认-服务成功笔数
     */
    private Integer scOrderCount;

    public static SRevenueSummaryExportBO build(SRevenueSummaryBO bo){
        SRevenueSummaryExportBO entity = new SRevenueSummaryExportBO();
        entity.setRevenueTypeName(bo.getRevenueTypeName());
        entity.setSubOrderAmountTotalBD(AmountUtil.getYUAN(bo.getSubOrderAmountTotal()));
        entity.setDiscountTotalBD(AmountUtil.getYUAN(bo.getDiscountTotal()));
        entity.setRevenueAmountTotalBD(AmountUtil.getYUAN(bo.getRevenueAmountTotal()));
        entity.setProductCostTotalBD(AmountUtil.getYUAN(bo.getProductCostTotal()));
        entity.setScOrderCount(bo.getScOrderCount());
        return entity;
    }
}
